Xbasic

WORD_WRAP Function

Syntax

New_String as C = word_wrap(C source_string [,N maximum_line_length])

Arguments

New_String

The word wrapped version of Old_String. Character

source_string

A string containing words in standard sentence format. Character

maximum_line_length

The maximum number of characters to place on a line. Numeric

Description

Convert a string to length limited lines, wrapping at the last full word.

Discussion

The WORD_WRAP() function breaks a string into multiple lines of maximum_line_length characters.

Example

dim s as C
s = "bird cow chicken goat tree shrub mouse flower"
? word_wrap(s, 30)
= bird cow chicken goat tree
shrub mouse flower

See Also